public class exercixe {


    //方法重载(顺序，参数个数，参数类型）
    public static int sum(int x,int y) {
        return x+y;
        //编译器就会给这行代码报错
        //System.out.println("adkhfaasa");
    }

    public static double sum(double x,double y) {
        return x+y;
    }
    public static int sum(int x,int y,int z) {
        return x+y;
    }

    public static int sum(int z) {
        return z;
    }


    public static void main1(String[] args) {
        //没有返回值的方法
        int a = 20;
        int b = 10;
        print(a,b);
    }
public static void print(int x,int y) {
    System.out.println("x = "+x+" y = "+y);
}


}
